package com.lgq.model;

import java.util.HashSet;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;

@Entity
public class College {
	private int id;
	private String name;
	private String volid;
	
	private Set<Project> projects=new HashSet<Project>();
	private Set<Department> departments=new HashSet<Department>();
	private Set<Team>teams=new HashSet<Team>();
	@Id
	@GeneratedValue
	public int getId() {
		return id;
	}
	public void setId(int id) {
		this.id = id;
	}
	public String getName() {
		return name;
	}
	public void setName(String name) {
		this.name = name;
	}
	public String getVolid() {
		return volid;
	}
	public void setVolid(String volid) {
		this.volid = volid;
	}
	@OneToMany(mappedBy="college")
	public Set<Project> getProjects() {
		return projects;
	}
	public void setProjects(Set<Project> projects) {
		this.projects = projects;
	}
	@OneToMany(mappedBy="college")
	public Set<Department> getDepartments() {
		return departments;
	}
	public void setDepartments(Set<Department> departments) {
		this.departments = departments;
	}
	@OneToMany(mappedBy="college")
	public Set<Team> getTeams() {
		return teams;
	}
	public void setTeams(Set<Team> teams) {
		this.teams = teams;
	}
	@Override
	public String toString() {
		return "College [id=" + id + ", name=" + name + ", volid=" + volid
				+ ", projects=" + projects + ", departments=" + departments
				+ ", teams=" + teams + "]";
	}
	
}
